package abstractClass;

abstract class BaseService {

    public abstract void printInfo() throws Exception;

    public void setInfo() throws Exception {
        printInfo();
    }
}


public class BaseChild extends BaseService{
    @Override
    public void printInfo() throws Exception {
        System.out.printf("this is info message!!!");
    }

    public static void main(String[] args) throws Exception {

        //继承了抽象类之后，可以实现抽象方法不同，但是调用抽象方法的方式相同
        BaseChild baseChild = new BaseChild();
        baseChild.setInfo();

        BaseChild2 baseChild2 = new BaseChild2();
        baseChild2.setInfo();
    }
}


class BaseChild2 extends BaseService{
    @Override
    public void printInfo() throws Exception {
        System.out.printf("this is info message2!!!!");
    }
}
